package edu.map.aamas.gui;

import java.awt.GridLayout;

import javax.swing.JFrame;
import javax.swing.JPanel;

import edu.map.aamas.rnn.RNN;

public class VarsCalibrationPanel extends JPanel {

	@SuppressWarnings("serial")
	public VarsCalibrationPanel() {
		setLayout(new GridLayout(0,1));
		add(new SliderPanel("K1", RNN.getInstance().k1, -20, 20) {
			public void sliderUpdated(float value) {
				super.sliderUpdated(value);
				RNN.getInstance().k1 = value;
			}
		});
		
		add(new SliderPanel("K2", RNN.getInstance().k2, -20, 20) {
			public void sliderUpdated(float value) {
				super.sliderUpdated(value);
				RNN.getInstance().k2 = value;
			}
		});
	
		add(new SliderPanel("_a1", RNN.getInstance()._a1, -1, 1) {
			public void sliderUpdated(float value) {
				super.sliderUpdated(value);
				RNN.getInstance()._a1 = value;
			}
		});
		
		add(new SliderPanel("_a2", RNN.getInstance()._a2, -1, 1) {
			public void sliderUpdated(float value) {
				super.sliderUpdated(value);
				RNN.getInstance()._a2 = value;
			}
		});
		
		add(new SliderPanel("alpha3", RNN.getInstance().alpha3, -3, 3) {
			public void sliderUpdated(float value) {
				super.sliderUpdated(value);
				RNN.getInstance().alpha3 = value;
			}
		});
		
		add(new SliderPanel("Max Ang", Math.toDegrees(Tadpole.FORCE_ANGLE_FACTOR), -180, 180) {
			public void sliderUpdated(float value) {
				super.sliderUpdated(value);
				Tadpole.FORCE_ANGLE_FACTOR = Math.toRadians(value);
			}
		});
		
		add(new SliderPanel("Force (debug)", 0, -1, 1) {
			public void sliderUpdated(float value) {
				super.sliderUpdated(value);
				Tadpole.getInstance().applyForce(value, PondPanel.getInstance().getWidth(), PondPanel.getInstance().getHeight());
			}
		});
	}
	
	public static void main(String[] args) {
		JFrame frame = new JFrame("testing...");
		frame.getContentPane().add(new VarsCalibrationPanel());
		frame.setSize(200, 200);
		frame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		frame.setVisible(true);
	}
}
